﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity.ModelConfiguration;
using BPM.Entity;

namespace BPM.Service.Mappings
{
	internal class ProductAssembleConfiguration : EntityConfiguration<ProductAssemble>
	{
		public ProductAssembleConfiguration()
		{
			this.HasRequired(m => m.ProductAssembleDefinition)
				.WithMany()
				.HasConstraint((m, p) => m.ProductAssembleDefinitionId == p.Id)
				.WillCascadeOnDelete();

			this.HasRequired(m => m.User)
				.WithMany()
				.HasConstraint((m, u) => m.UserId == u.Id)
				.WillCascadeOnDelete(false);
		}
	}
}